package com.weblog.user.dao;

import com.weblog.model.user.CusCategory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * @author MaoLin Wang
 * @date 2019/11/121:19
 */
public interface CusCategoryDao extends JpaRepository<CusCategory,String>, JpaSpecificationExecutor<CusCategory> {

    /**
     * 修改categoris信息
     * @param userid 用户id
     * @param category 分类json
     */
    @Query(value = "update tb_cus_category set categories=?2 where  userid=?1",nativeQuery = true)
    @Modifying
    void updateContent(String userid, String category);
}
